<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-08-18
 * Time: 16:37
 */

namespace App\Http\Requests\Admin;


use Illuminate\Foundation\Http\FormRequest;


class ClientVisitDTO extends FormRequest
{

    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'client_id' => 'required|exists:clients,id',
            'date' => 'required|date',
            'picture' => 'array|max:5',
            'picture.*' => 'max:200',
            'content' => 'required|max:1000',
        ];
    }

    public function messages()
    {
        return [
            'client_id.required' => '客户信息不存在',
            'client_id.exists' => '客户信息不存在',
            'date.required' => '回访时间必须选择',
            'date.date' => '回访时间格式错误',
            'picture.array' => '图片上传错误',
            'picture.size' => '最多只能上传5张图片',
            'picture.*.max' => '图片地址过大',
            'content.required' => '回访内容必须填写',
            'content.max' => '回访内容不能超过1000个字符',
        ];
    }
}